package com.ramos.kuaixiao.entity;

import com.ramos.kuaixiao.utils.StringUtil;

import java.io.Serializable;


public class ProductType implements Serializable {

    public int idx;

    public String typeId;

    public String parentTypeId;

    public String name;

    public String comment;

    public String dealerId;

    public int treeLevel;

    public Long modifyTime;

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    public String getParentTypeId() {
        return parentTypeId;
    }

    public void setParentTypeId(String parentTypeId) {
        this.parentTypeId = parentTypeId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getDealerId() {
        return dealerId;
    }

    public void setDealerId(String dealerId) {
        this.dealerId = dealerId;
    }

    public int getTreeLevel() {
        return treeLevel;
    }

    public void setTreeLevel(int treeLevel) {
        this.treeLevel = treeLevel;
    }

    public Long getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Long modifyTime) {
        this.modifyTime = modifyTime;
    }

    public ProductType(String type_id, String parent_type_id, String name, String comment, String dealer_id, int tree_level, Long modify_time) {
        this.typeId = type_id;
        this.parentTypeId = parent_type_id;
        this.name = name;
        this.comment = comment;
        this.dealerId = dealer_id;
        this.treeLevel = tree_level;
        this.modifyTime = modify_time;
    }
    public ProductType(){}

    public void recoverTypeId(){
        if(!StringUtil.isEmpty(typeId) && typeId.contains("_")){
            typeId = typeId.substring(typeId.indexOf("_")+1);
        }
    }
}



